import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

// 获取汇总列表
export async function queryTableList(params) {
	return request(`/new-wms/pickinggoodssummary/select`, {
		method: "post",
		data: params,
	});
}

// 获取打印记录列表
export async function queryRecordList(params) {
	return request(`/new-wms/pickinggoodssummary/selectPrint`, {
		method: "post",
		data: params,
	});
}

// 保存打印记录列表
export async function savePrintData(params) {
	return request(`/new-wms/pickinggoodssummary/savePrint`, {
		method: "post",
		data: params,
	});
}

// 获取打印记录详情
export async function getRecordPrintDetail(params) {
	return request(`/new-wms/pickinggoodssummary/selectPrintDetail?${stringify(params)}`);
}

//门店编码模糊查询
export async function selectStoreAreasByName(params) {
  return request(`/zjf-wms/storecodesort/selectListByName?${stringify(params)}`);
}

//模糊查询下拉供应商列表 storeName：供应商名称
export async function queryFactoryList(params) {
  return request(`/blade-goods/zjfstore/list/fuzzyQueryPage?${stringify(params)}`);
}



//6.1 快销采购列表
export async function getFmcgpurchasesList(params) {
	return request(`/new-wms/fmcgpurchases/listPage?${stringify(params)}`, { loading: true });
}
// 拿货员列表
export async function queryTakeUserList(params) {
	return request(`/blade-user/childUsers?${stringify(params)}`, { loading: true });
}

export async function getFindSupplierNumPage(params) {
	return request(`/new-wms/fmcgpurchases/findSupplierNumPage?${stringify(params)}`, { loading: true });
}


// 取消标记异常
export async function uniquecodesCancelMarkExc(params) {
	return request(`/new-wms/uniquecodes/cancelMarkExc`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 拿货指派
export async function fmcgpurchasesAppointReceivingClerk(params) {
	return request(`/new-wms/fmcgpurchases/appointReceivingClerk`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 快销采购支付
export async function outboundproductsPay(params) {
	return request(`/new-wms/outboundproducts/pay`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 唯一码配置读取
export async function getUniqueconfigList() {
	return request(`/new-wms/uniqueconfig/list`, { loading: true });
}
// 唯一码打印接口
export async function getPrintTemp(params) {
	return request(`/new-wms/fmcgpurchases/getPrintTemp?${stringify(params)}`, { loading: true });
}
// // 唯一码打印成功后请求
// export async function updatePrintStatus(params) {
// 	return request(`/new-wms/uniquecodes/updatePrint?${stringify(params)}`);
// }

export async function updatePrintStatus(params) {
	return request(`/new-wms/uniquecodes/updatePrint`, {
		method: "post",
		data: params
		// loading: true
	});
}
// 修改唯一码配置
export async function uniqueconfigSubmit(params) {
	return request(`/new-wms/uniqueconfig/submit`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 供应商拿货
export async function fmcgpurchasesUpdateFmcgPurchaseSupplier(params) {
	return request(`/new-wms/fmcgpurchases/updateFmcgPurchaseSupplier`, {
		method: "post",
		data: params,
		loading: true
	});
}

export async function getFmcgpurchaseslistArea() {
	return request(`/new-wms/fmcgpurchases/listArea`, { loading: true });
}

//获取商品唯一码打印数据
export async function getPrintData(params) {
	return request(`/zjf-wms/hiprint/getTakeGoodsPrintData`, {
		method: "post",
		data: params,
		loading: true
	});
}

//获取商品唯一码打印数据(已拿货列表筛选)
export async function queryTakenGoodsPrintData(params) {
	return request(`/zjf-wms/hiprint/getTakenGoodsPrintData`, {
		method: "post",
		data: params,
		loading: true
	});
}

//获取商品唯一码打印数据
export async function getPrintDataByUniqeCode(params) {
	return request(`/zjf-wms/hiprint/getPrintUniqueCodes/uniqueCodes`, {
		method: "post",
		data: params,
		loading: true
	});
}
// 所属仓库
export async function queryBatchWarehouseList(params) {
	return request(`/zjf-wms/client/kx/warehouse/queryBatchWarehouseList?${stringify(params)}`);
}
// 快递公司列表
export async function queryExpressList(params) {
	return request(`/blade-logistics/expresskxerp/expressKv?${stringify(params)}`);
}
//区域编码模糊查询
export async function queryAreaCode(params) {
	return request(`/zjf-wms/storecodesort/selectListByName?${stringify(params)}`);
}
